<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, minimal-ui" />
        
        <title>Account Documentation</title>
        
        <script src="/js/greyspots.js" type="text/javascript"></script>
        <link href="/css/greyspots.css" type="text/css" rel="stylesheet" />
        
        <script src="/js/ace/ace.js" data-ace-base="/js/ace/" type="text/javascript" charset="utf-8"></script>
        <script src="/js/ace/ext-language_tools.js" type="text/javascript"></script>
        <script src="/js/ace/ext-searchbox.js" type="text/javascript"></script>
        
        <script src="doc-library/doc.js" type="text/javascript"></script>
        <link href="doc-library/doc.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <gs-jumbo>
            <h1 class="text-center">Account Functions</h1>
        </gs-jumbo>
            
        <gs-container min-width="sml;med;lrg">
            <h3>Functions:</h3>
            <pre><code>GS.userChangePassword();
GS.superChangePassword();
GS.superUserLogin(&lt;LOGGED-IN-CALLBACK&gt;);</code></pre>
            
            <h3>Description:</h3>
            <p>
                These functions handle some account-related operations.
            </p>
            
            <div txt-warning bg-warning>
                <h3>Warning:</h3>
                <p>
                    The first two examples on this page will change this account's passwords if you allow them, please use caution.
                </p>
            </div>
            
            <h1>Examples:</h1>
            <div class="doc-example-description">
                <span class="h3">GS.userChangePassword Example:</span><br />
                <p>In this example when you click the "" button the GS.userChangePassword function will open a dialog that will allow you to change your normal user password.</p>
            </div>
            <gs-doc-example>
                <template for="html" height="30">
                    <gs-button onclick="GS.userChangePassword()">
                        Change Normal User Password
                    </gs-button>
                </template>
            </gs-doc-example>
            
            <div class="doc-example-description">
                <span class="h3">GS.superChangePassword Example:</span><br />
                <p>In this example when you click the "" button the GS.superChangePassword function will open a dialog that will allow you to change your super user password.</p>
            </div>
            <gs-doc-example>
                <template for="html" height="30">
                    <gs-button onclick="GS.superChangePassword()">
                        Change Super User Password
                    </gs-button>
                </template>
            </gs-doc-example>
            
            <div class="doc-example-description">
                <span class="h3">GS.superUserLogin Example:</span><br />
                <p>This function will check to see if you are logged in as a superuser. If you are not logged in as a superuser: the function will open a dialog so that you can log in as a superuser then when you successfully log in: the callback will be called. If you are already logged in as a superuser it will just call the callback.<br /><br />
                
                Note: You have to be logged in as a superuser to load this documentation page so unless you log out in a seperate window: you will just go straight to the callback.</p>
            </div>
            <gs-doc-example>
                <template for="html" height="10">
                    <gs-button onclick="testSuperUserLogin()">Log In Super</gs-button>
                    <br />
                    <div id="result"></div>
                </template>
                <template for="js" height="10">
                    function testSuperUserLogin() {
                        GS.superUserLogin(function () {
                            document.getElementById('result').textContent =
                                'You are logged in as a superuser.'
                        });
                    }
                </template>
            </gs-doc-example>
        </gs-container>
    </body>
</html>